<!DOCTYPE html>
<html>
<body>

<p>Click the button to display a confirm box.</p>

<button onclick="myFunction('<?php echo "123"; ?>')">Try it</button>

<p id="demo"></p>

<script>
function myFunction(id)
{
var x;
var r=confirm("Pressed id: " + id);
if (r==true)
  {
  //x="You pressed OK!";
  document.location = "index.php?action=DoThis";
  }
else
  {
  x="You pressed Cancel!";
  document.getElementById("demo").innerHTML=x;
  }
}
</script>

</body>
</html>